<%--
  Created by IntelliJ IDEA.
  User: csnf
  Date: 2024/12/30
  Time: 11:50
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        th, td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
        tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        tr:hover {
            background-color: #f1f1f1;
        }
        .action-links a {
            display: inline-block;
            margin: 0 5px;
            padding: 5px 10px;
            text-decoration: none;
            color: white;
            border-radius: 5px;
        }
        .action-links a.delete {
            background-color: #dc3545;
        }
        .action-links a.modify {
            background-color: #007bff;
        }
    </style>
</head>
<body>
<table>
    <tr>
        <th>任务名称</th>
        <th>任务分组</th>
        <th>任务内容</th>
        <th>任务表达式</th>
        <th>任务状态</th>
        <th>任务日期</th>
        <th>任务策略</th>
        <th>任务当前</th>
        <th>任务描述</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${tasks}" var="task">
        <tr>
            <td>${task.taskName}</td>
            <td>${task.taskGroup}</td>
            <td>${task.taskContent}</td>
            <td>${task.taskExpression}</td>
            <td>${task.taskState}</td>
            <td>${task.taskDate}</td>
            <td>${task.taskStrategy}</td>
            <td>${task.taskCurrent}</td>
            <td>${task.taskDesc}</td>
            <td>
                <a href="/getTaskById?taskId=${task.taskId}">修改</a>
                <a href="javascript:void(0)" onclick="deleteTask(${task.taskId})">删除</a>
            </td>
        </tr>
    </c:forEach>
    <script>
        function deleteTask(taskId) {
            if (confirm("确定要删除该任务吗？")) {
                location.href = "/deleteTask?taskId=" + taskId;
            }
        }
    </script>
</table>
</body>
</html>
